<template>
	<view class="p30">
		<template v-if="total">
			<view v-for="(item,index) in list" :key="index"
			 style="border-radius: 10rpx;" class="box mt30 p20 u-flex bg-white ">
				<view class="u-flex  header">
					<image class="headimg" :src="item.headimgurl=='.'?'../../../static/public/images/headimgurl.jpg':item.headimgurl" mode=""></image>
					<view style="display: flex;flex-direction: column;margin-left: 10rpx;">
						<text style="font-size: 28rpx;">{{item.nick_name}} (ID:{{item.user_id}})</text>
						<text class="mt10" style="font-size: 24rpx;">签到时间：{{$u.timeFormat(item.sign_in_time, 'yyyy-mm-dd hh:MM')}}</text>
					</view>
				</view>
			</view>
			<view class="mt20">
				<u-loadmore :load-text="loadText" bg-color="#f3f3f3" :status="status" />
			</view>
		</template>
		<template v-else>
			<u-empty style="margin-top: 100rpx;" text="无数据" mode="list"></u-empty>
		</template>
		
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id:'',
				status: 'loadmore',
				last_page:0,
				total:0,
				page:1,
				loadText: {
					loadmore: '加载更多',
					loading: '努力加载中',
					nomore: '实在没有了'
				},
				list:[]
			}
		},
		onLoad(e) {
			this.id =e.id?e.id:""
			this.getList()
		},
		onReachBottom(){
			if(this.page>=this.last_page){
				this.status='nomore'
			}
			this.page +=1
			this.getList()
		},
		methods: {
			go(id){
				uni.navigateTo({
					url:"pages/member/meeting/sign-log?id="+id,
				})
			},
			getList(){
				this.status='loading'
				this.$u.get('member/api.users/signInList',{id:this.id,page:this.page}).then(res => {
					this.list =[...this.list,...res.data.data]
					this.last_page =res.data.last_page
					this.total =res.data.total
					if(this.page>=this.last_page){
						this.status='nomore'
					}else{
						this.status='loadmore'
					}
				})
			},
			signIn(){
				this.$u.get('member/api.users/signIn', {
					sign_code: this.code
				}).then(res => {
					this.getInfo()
					uni.showToast({
						icon:"success",
						title:res.msg
					})
				})
			},
		}
	}
</script>

<style lang="scss">
	.headimg{
		width: 100rpx;
		height: 100rpx;
		border-radius: 100%;
	}
	.bg-info{
		background-color: $u-type-warning-light;
	}
	.opacity{
		opacity: 0.5;
	}
	.sign{
		
		width: 280rpx;
		height: 280rpx;
		border-radius: 100%;
		
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		text{
			font-size: 60rpx;
			font-weight: bold;
			color:#fff;
		}
	}
	.box{
		width: 100%;
		flex-direction: column;
		display: flex;
		justify-content: space-between;
		align-items: center;
		.title{
			font-size: 34rpx;
		}
		.header{
			display: flex;
			width: 100%;
			align-items: center;
		}
		.foot{
			display: flex;
			width: 100%;
			color: $u-tips-color;
			justify-content: space-between;
			align-items: center;
			.times{
				flex-direction: column;
				display: flex;
			}
		}
	}
</style>
